import http from '../request';
const apibase = '/api/JobRecord';
import qs from 'qs';

/** 根据设备id获取工作记录 */
var getJobGroupListByProSegment = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/GetJobGroupListByProSegment`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};

/** 根据设备id获取工作记录模板明细 */
var getJobRecordListByProSegment = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/GetJobRecordListByProSegment`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};
/** 根据设备ID获取工作集批记录 */
var getJobRecordByProSegmentID = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/GetJobRecordByProSegmentID`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};

export {
  getJobGroupListByProSegment,
  getJobRecordListByProSegment,
  getJobRecordByProSegmentID,
};
